/*package com.atguigu.gulistudy.auth.config;

import com.atguigu.common.exception.BizCodeEnume;
import com.atguigu.common.utils.R;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.context.annotation.Configuration;*/

/**
 * @author hnb
 * @version 1.0
 * @Description:
 * @date 2022/8/17 上午9:05
 */
/*@Configuration
public class MallAuthServerSentinelConfig {

    public MallAuthServerSentinelConfig() {

        WebCallbackManager.setUrlBlockHandler(new UrlBlockHandler() {
            @Override
            public void blocked(HttpServletRequest request, HttpServletResponse response, BlockException ex) throws IOException {
                R error = R.error(BizCodeEnume.TO_MANY_REQUEST.getCode(), BizCodeEnume.TO_MANY_REQUEST.getMessage());
                response.setCharacterEncoding("UTF-8");
                response.setContentType("application/json");
                response.getWriter().write(JSON.toJSONString(error));

            }
        });

    }
}*/
